package no.gnet.edvd.types;

import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

public class Bet extends Persist{
	public Event event;
	public Option option;
	public double amount;
	public Currency currency;
	public Player player;	
	public DateTime timeofbet;
	public boolean iswin=false;
	public Transfer completedTransfer;
	
	public Bet(Event event, Option option, double amount, Currency currency,Player player, DateTime timeofbet) {
		super();
		this.event = event;
		this.option = option;
		this.amount = amount;
		this.currency = currency;
		this.player=player;
		this.timeofbet=timeofbet;
	}
	
	public Bet(Event event, Option option, double amount, Currency currency,Player player, DateTime timeofbet, int id) {
		super();
		this.event = event;
		this.option = option;
		this.amount = amount;
		this.currency = currency;
		this.id=id;
		this.player=player;		
		this.timeofbet=timeofbet;
	}

	public Event getEvent() {
		return event;
	}

	public Option getOption() {
		return option;
	}

	public double getAmount() {
		return amount;
	}

	public Currency getCurrency() {
		return currency;
	}

	public Player getPlayer() {
		return player;
	}

	public DateTime getTimeofbet() {
		return timeofbet;
	}
	
	public String getFormattedTimeOfBet(){
		DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MMMM-dd HH:mm");
		return fmt.print(timeofbet);
	}

	public Transfer getCompletedTransfer() {
		return completedTransfer;
	}

	public void setCompletedTransfer(Transfer transfer) {
		this.completedTransfer = transfer;
	}
}
